// import { decrypt, encrypt } from './jsencrypt'
import { ChromeGlobalTokenStorage } from './handleChromeStorange'
// 获取token
export const getToken = () => {
    // 此处与TokenKey相同，此写法解决初始化时Cookies中不存在TokenKey报错
    return ChromeGlobalTokenStorage.get()
}

// 刷新token
export const getRefreshToken = () => {
    return ''
}

// 设置token
export const setToken = (token: string) => {
    return ChromeGlobalTokenStorage.set(token)
}

// 删除token
export const removeToken = () => {
    return ChromeGlobalTokenStorage.remove()
}

/** 格式化token（jwt格式） */
export const formatToken = (token: string): string => {
    return 'Bearer ' + token
}
